#include <stdio.h>
#include <stdlib.h>

class A
{
public:
	A() { printf( "A constructor\n" ); }

	virtual ~A() { printf( "A destructor. value %d\n", m_i ); }

	A( const A &a ) { printf( "A copy-constructor\n" ); }

	const A & operator=( const A &a ) { printf( "A operator=\n" ); }

	void set_i( int i ) { m_i = i; }
	int get_i( void ) { return m_i; }

private:
	int m_i;
};

void f( A a ){}

A f_1( void )
{
	A a;

	a.set_i( 10 );
	return a;
}

class B
{
private:
	int i;
	A a;
};

int main( int argc, char *argv[] )
{
	A b;

	printf( "mark\n" );
	b = f_1();
	//A b = f_1();
	b.set_i( 100 );
//	printf("value %d\n", b.get_i());
	printf( "mark\n" );
}
